package com.nopay.dxdwphone.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.github.ybq.android.spinkit.sprite.Sprite;
import com.github.ybq.android.spinkit.style.ThreeBounce;
import com.nopay.dxdwphone.R;

/**
 * 联系客服
 */
public class DialogRecallLoading extends Dialog {

    public DialogRecallLoading(@NonNull Activity context) {
        super(context, R.style.MyDialog);
    }

    private TextView tv_loading;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_recall_loading);
        setCanceledOnTouchOutside(false);

        tv_loading = findViewById(R.id.tv_loading);
        tv_loading.setText("正在创建重拨任务....");

        ProgressBar progressBar = findViewById(R.id.spin_kit);
        Sprite threeBounce = new ThreeBounce();
        progressBar.setIndeterminateDrawable(threeBounce);
    }

    public void setLoadingText(String text) {
        if(isShowing() && tv_loading != null) {
            tv_loading.setText(text);
        }
    }
}



